<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="年度">
              <a-date-picker
                mode="year"
                placeholder="请选择年份"
                format="YYYY"
                value-format="yyyy-MM-dd"
                v-model="queryParam.year"
                :open="yearPickShow"
                style="width: 100%"
                @panelChange="handlePanelChange"
                @openChange="handleOpenChange"
              />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="季度">
              <j-dict-select-tag
                style="width: 100%"
                v-model="queryParam.quarter"
                placeholder="请选择"
                dict-code="sys_quarter"
              />
            </a-form-item>
          </a-col>
          <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
          <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">清除条件</a-button>
        </a-row>
      </a-form>
    </div>
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record, '抽调审计人员费用统计表')">查看</a>
          <!--          <a-divider type="vertical"/>-->
          <!--          <a @click="handleDownload(record)">下载</a>-->
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->

    <CheckAndEditModel ref="modalForm" @ok="modalFormOk"></CheckAndEditModel>
  </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CheckAndEditModel from './CheckAndEditModel'
import moment from 'moment'
import 'moment/locale/zh-cn'
import columns from './indexColumns'
import store from '@/store/'

export default {
  name: '抽调审计人员费用汇总',
  mixins: [JeecgListMixin],
  components: {
    CheckAndEditModel,
  },
  data() {
    return {
      queryParam: {
        year: '',
        quarter: '',
      },
      superParam: {
        officeId: store.getters.departInfo.id,
        type: 4,
      },
      // 表头
      columns: columns(this),
      url: {
        list: '/sjxxzhbb/sjAuditSummaryInfo/queryAuditSummaryInfoList',
      },
      yearPickShow: false,
    }
  },
  computed: {},
  created() {},
  methods: {
    searchReset() {
      this.queryParam = this.$options.data().queryParam
      this.loadData(1)
    },
    // 弹出日历和关闭日历的回调
    handleOpenChange(status) {
      this.yearPickShow = status
      if(this.queryParam.year){
        this.queryParam.year = moment(this.queryParam.year.slice(0, 4)).format('YYYY')
      }
    },
    moment,
    // 得到年份选择器的值
    handlePanelChange(value) {
      this.yearPickShow = false
      this.queryParam.year = moment(value).format('YYYY')
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>